$(".billalter").click(function(){
	var url=$(this).attr("href");
	$.ajax({
		"url":url,
		"dataType":"json",
		"success":function(data){
			if(data.outcome==1){
				alert("操作成功");
				window.location=window.location.href;
			}else{
				alert(data.msg);
			}
		}
	});
	return false;
});

$(function(){
    $("#suggest_ul").hide(0);
});
$(function(){
    $("#suggest_input").keyup(function(){
        if($("#suggest_input").val().length<=0){
            $("#li_id").val("");
            $("#suggest_ul").hide(0);
            return;
        }
        var listTxt = '',li = '', bEqual=false;

        $.ajax({
            "url" : "http://www.12301.cc/call/jh_mem.php",
            "data" : {action:'fuzzyGetDname_c', dname:$("#suggest_input").val(),dtype:$("#lid_id").val()},
            "dataType":"json",
            "type": 'POST',
            "success":function(data){
                $("#suggest_ul").show(0);
                var contents="";
                var li_id="";
                for(var i in data) {
                    var keywords = data[i].dname;
                    var id = data[i].id;
                    contents=contents+"<li data-id='"+id+"'>"+keywords+"</li>";
                    li_id=id;
                }
                $("#suggest_ul").html(contents);
                $("#li_id").val(li_id);
            }
        });
    });
    $("#suggest_ul").on("click","li",function(e){
        var target = $(e.currentTarget);
        var id = target.data("id");
        $("#suggest_input").val(target.text());
        $("#li_id").val(id);
        $("#suggest_ul").hide(0);
    })

});